#ifndef __singleton_H__
#define __singleton_H__

//单例类模板
template<typename T>
class Sngleton
{
public:
    static T* GetInstance()
    {
        if(m_instance == nullptr)
        {
            m_instance = new T();
        }
        return m_instance;
    }

private:
    Sngleton() {}
    Sngleton(const Sngleton<T>&) {}
    ~Sngleton() {}
    Sngleton<T>& operator=(const Sngleton<T>) = delete;

private:
    static T* m_instance;
};

template<typename T>
T* Sngleton<T>::m_instance = nullptr;


#endif
